//
//  ViewController.m
//  testToast
//
//  Created by Firstiar Noorwinanto on 10/24/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import "ViewController.h"
#import "iKToast.h"

@implementation ViewController

@synthesize title;

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}

-(IBAction)buttonToastTopClicked:(id)sender {
    [iKToast showToastWithString:@"Hello World!"
                        duration:1
                    withDistance:30
                      inPosition:iKToastPositionTop];
}

-(IBAction)buttonToastMiddleClicked:(id)sender {
    UIView *view = [iKToast getMessageView:@"Hello World!"];
    CGRect frame = view.frame;
    frame.size.width += 100;
    frame.size.height += 100;
    view.frame = frame;
    [iKToast showToastWithView:view
                        duration:1
                    withDistance:30
                      inPosition:iKToastPositionMiddle];
}

-(IBAction)buttonToastBottomClicked:(id)sender {
    /*[iKToast showToastWithString:@"Hello World!"
                        duration:1
                    withDistance:30
                      inPosition:iKToastPositionBottom
                         stacked:YES];*/
    [[iKToast sharedInstance] setPosition:iKToastPositionBottom];
    [[iKToast sharedInstance] showToastMessage:@"Hello World!"];
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    [[iKToast sharedInstance] setDuration:2];
    [[iKToast sharedInstance] setDistance:30];
    [[iKToast sharedInstance] setPosition:iKToastPositionBottom];
    [[iKToast sharedInstance] setStacked:YES];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
	[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
	[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return YES;
}

@end
